<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<%@include file="/view/resource.jsp"%>
		<script type="text/javascript"
			src="${msUrl}/js/ux/bill/in_bill.js"></script>
	</head>
	<body class="easyui-layout">
		<!-- Search panel start -->
		<div class="ui-search-panel" region="north" style="height: 80px;"
			title="搜索框"
			data-options="striped: true,collapsible:false,iconCls:'icon-search',border:false">
			<form id="searchForm" name="searchForm">
				<p class="ui-fields">
				    <label>货单号:</label>  
		            <input name="number" class="easyui-box ui-text"
						style="width: 100px;">
					<label class="ui-label">
						产品编号:
					</label>
					<input name="product.code" class="easyui-box ui-text"
						style="width: 100px;">
					<label class="ui-label">
						产品名称:
					</label>
					<input name="product.name" class="easyui-box ui-text"
						style="width: 100px;">
						<!-- 
					<label class="ui-label">
						订单编号:
					</label>
					<input name="orderInfo.number" class="easyui-box ui-text"
						style="width: 100px;">
						 -->	
					<label class="ui-label">
						商家名称:
					</label>
					<input name="merchant.name" class="easyui-box ui-text"
						style="width: 100px;">
					<label class="ui-label">
						所在仓库:
					</label>
					<input name="repository.name" class="easyui-box ui-text"
						style="width: 100px;">
					<label class="ui-label">
						入库状态:
					</label>
					 <select name="checkStatus" class="easyui-combobox">
					 <option></option>
					 <option value="0">未入库</option>
					 <option value="1">已入库</option>
					 </select>
                    <label>开始日期:</label>  
		            <input name="beginDate" class="easyui-datebox">
		            <label>结束日期:</label>  
		            <input name="endDate" class="easyui-datebox">
		            <input class="hidden" type="text" name="type" value="1">
		            <input class="hidden" type="text" name="product.type" value="1">
				</p>
				<a href="#" id="btn-search" class="easyui-linkbutton"
					iconCls="icon-search">搜索</a>
				<a href="#" id="export-btn" class="easyui-linkbutton" data-options="toggle:true">导出Excel文件</a>
			</form>
		</div>
		<!--  Search panel end -->

		<!-- DataList  -->
		<div region="center" border="false">
			<table id="data-list" data-options="showFooter: true"></table>
		</div>
		
		<!-- Edit Form -->
     <div id="edit-win" class="easyui-dialog" title="编辑" data-options="closed:true,iconCls:'icon-save',modal:true" style="width:400px;height:400px;">  
     	<form id="editForm" class="ui-form" method="post">  
     		 <input class="hidden" type="text" name="id">
     		 <input class="hidden" name="deleted">
     		 <div class="ui-edit">
	     	   <div class="ftitle">进货明细信息</div>  
	     	   <div class="fitem">  
	               <label>货单号:</label>  
	               <input class="easyui-validatebox" type="text" name="number" data-options="required:true,validType:'length[1,20]'">
	           </div>
	           <input type="hidden" name="type" value="1">  
	             
	           <div class="fitem">  
	               <label>账单日期:</label>  
	               <input id="dd" type="text" name="billDate" class="easyui-datebox" data-options="required:true">
	           </div>
	           <div class="fitem">  
	               <label>订单编号:</label>  
	               <input id="cc7" class="easyui-combobox" name="orderInfoId" data-options="valueField:'id',
	               textField:'number',url:'../order_info/queryAllOrderInfos.do'">
	           </div>
	           <div class="fitem">  
	               <label>所属仓库:</label>  
	               <input id="cc" class="easyui-combobox" name="repositoryId" data-options="valueField:'id',textField:'name',url:'../repository/loadRepositoryList.do'">
	           </div>
	           <div class="fitem">  
	               <label>商家:</label>  
	               <input id="cc1" class="easyui-combobox" name="merchantId" data-options="valueField:'id',
	               textField:'name',url:'../merchant/loadMerchantList.do?type=1',onSelect: function(rec){ 
	               var url = '../product/loadProdListByMerchant.do?merchantId='+rec.id;
	               $.get(url,function(data){
	               $('#cc2').combogrid('grid').datagrid('loadData',data);
	               });
	               }
	               ">
	           </div>
	           <div class="fitem">  
	               <label>产品:</label>  
	               <select id="cc2" class="easyui-combogrid" style="width:130px" name="productId" 
	               data-options="idField:'id',
	                textField:'name',panelWidth: 500,columns: [[
	                {field:'id',title:'ID',width:50},
			        {field:'code',title:'编号',width:50},
			        {field:'name',title:'名称',width:50},
			        {field:'color',title:'颜色',width:50},
			        {field:'standard',title:'规格',width:50,sortable:true}
			        ]],fitColumns: true,mode:'local'
			        "></select>
	           </div>
	           <div class="fitem">  
	               <label>单价:</label>  
	               <input id="price" type="text" name="price" class="easyui-numberbox" data-options="min:0,precision:2">
	           </div>
	           <div class="fitem">  
	               <label>数量:</label>  
	               <input type="text" name="quantity" class="easyui-numberbox" data-options="min:0">
	           </div> 
	           <div class="fitem">  
		           <label>备注:</label>  
		           <textarea class="easyui-validatebox" data-options="required:false,length:[0,100]" name="remark"></textarea>
		       </div>  
	         </div>
     	</form>
  	 </div> 
  	 
  	 <!-- View Form -->
     <div id="view-win" class="easyui-dialog" title="查看" data-options="closed:true,iconCls:'icon-search',modal:true" style="width:400px;height:400px;">  
     	<form id="viewForm" class="ui-form" method="post">  
     		 <input class="hidden" type="text" name="id">
     		 <input class="hidden" name="deleted">
     		 <div class="ui-edit">
	     	   <div class="ftitle">进货明细信息</div>  
	     	   <div class="fitem">  
	               <label>货单号:</label>  
	               <input class="easyui-validatebox" type="text" name="number" data-options="required:true,validType:'length[1,20]'" disabled="disabled">
	           </div>
	           <input type="hidden" name="type" value="1">  
	             
	           <div class="fitem">  
	               <label>账单日期:</label>  
	               <input id="dd" type="text" name="billDate" class="easyui-datebox" data-options="required:true" disabled="disabled">
	           </div>
	           <div class="fitem">  
	               <label>订单编号:</label>  
	               <input id="cc8" class="easyui-combobox" name="orderInfoId" data-options="valueField:'id',
	               textField:'number',url:'../order_info/queryAllOrderInfos.do'" disabled="disabled">
	           </div>
	           <div class="fitem">  
	               <label>所属仓库:</label>  
	               <input id="cc" class="easyui-combobox" name="repositoryId" data-options="valueField:'id',textField:'name',url:'../repository/loadRepositoryList.do'" disabled="disabled">
	           </div>
	           <div class="fitem">  
	               <label>商家:</label>  
	               <input id="cc3" class="easyui-combobox" name="merchantId" data-options="valueField:'id',
	               textField:'name',url:'../merchant/loadMerchantList.do?type=1',onSelect: function(rec){ 
	               var url = '../product/loadProdListByMerchant.do?merchantId='+rec.id;
	               $.get(url,function(data){
	               $('#cc2').combogrid('grid').datagrid('loadData',data);
	               });
	               }
	               " disabled="disabled">
	           </div>
	           <div class="fitem">  
	               <label>产品:</label>  
	               <select id="cc4" class="easyui-combogrid" style="width:130px" name="productId" 
	               data-options="idField:'id',
	                textField:'name',panelWidth: 500,columns: [[
	                {field:'id',title:'ID',width:50},
			        {field:'code',title:'编号',width:50},
			        {field:'name',title:'名称',width:50},
			        {field:'color',title:'颜色',width:50},
			        {field:'standard',title:'规格',width:50,sortable:true}
			        ]],fitColumns: true,mode:'local'
			        " disabled="disabled"></select>
	           </div>
	           <div class="fitem">  
	               <label>单价:</label>  
	               <input id="price" type="text" name="price" class="easyui-numberbox" data-options="min:0,precision:2" disabled="disabled">
	           </div>
	           <div class="fitem">  
	               <label>数量:</label>  
	               <input type="text" name="quantity" class="easyui-numberbox" data-options="min:0" disabled="disabled">
	           </div> 
	           <div class="fitem">  
		           <label>备注:</label>  
		           <textarea class="easyui-validatebox" data-options="required:false,length:[0,100]" name="remark" disabled="disabled"></textarea>
		       </div>  
	         </div>
     	</form>
  	 </div> 
	</body>
</html>
